import {
  getCurrentFileFromLocal,
  getOpenKeysFromLocal,
  getSelectedKeysFromLocal
} from './localstorage';

import { DEFAULT_TAB_JSON_MODEL } from '@renderer/utils/constant';
import { atom } from 'jotai-vue'

export const fileTreeAtom = atom({});

export const currentFileAtom = atom(getCurrentFileFromLocal());

export const workspaceLoadedAtom = atom(false);

export const folderListAtom = atom([]);

export const currentFolderIdAtom = atom(undefined);

export const siderbarCollapsedAtom = atom(false);

export const langCodeAtom = atom('en');

export const themeAtom = atom('light');

export const tabJsonModelAtom = atom(DEFAULT_TAB_JSON_MODEL);
export const tabModelAtom = atom(undefined);

export const selectedKeysAtom = atom(getSelectedKeysFromLocal());

export const openKeysAtom = atom(getOpenKeysFromLocal());

export const focusItemAtom = atom('');
